package com.itheima.day06.extra3;

import java.util.Random;
import java.util.Scanner;

public class jianDaoShiTouBu {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = -1;
        do {
            System.out.println("剪刀0，石头1 ，布2");
            a = Integer.parseInt(sc.nextLine());
        } while (a != 0 && a != 1 && a != 2);
        int pc = new Random().nextInt(3);
        if (pc == 0) {
            System.out.println("电脑出的剪刀");
            switch (a) {
                case 0:
                    System.out.println("平手");
                    break;
                case 1:
                    System.out.println("恭喜你获胜了！");
                    break;
                case 2:
                    System.out.println("你输了");
                    break;
                default:
                    System.out.println("输入错误！");
            }
        } else if (pc == 1) {

        } else if (pc == 2) {

        }
    }
}
